package com.apes.scm.stock.inventory.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.scm.stock.inventory.model.InventoryDiffCompound;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface InventoryDiffCompoundRepository extends CustomRepository<InventoryDiffCompound, String> {
    @Modifying
    @Query(value = "UPDATE STO_INVENTORY_DIFF_COMPOUND SET COMPLEX_DIFFERENCE_QTY = COMPOUND_QTY - CUSTODY_QTY WHERE INVENTORY_IDS = ?1", nativeQuery = true)
    void updateInventoryDiffCompound(String id);
}
